package com.xxmw.transaction.common.utils.http;

import org.apache.http.Header;
import org.apache.http.message.BasicHeader;

import java.util.ArrayList;
import java.util.List;

/**
 * @author luowenliang
 * @since 2020/2/27 15:06
 */
public class HttpHeader {

    List<Header> headerList = new ArrayList<>();

    public HttpHeader add (String key, String value) {
        this.headerList.add(new BasicHeader(key, value));
        return this;
    }

    public Header[] getHeaders () {
        Header[] headers = new Header[headerList.size()];
        return headerList.toArray(headers);
    }
}
